home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / CIncludes / Controls.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-06  |  22.5 KB  |  633 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Controls.h
  3.  
  4.      Contains:    Control Manager interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __CONTROLS__
  21. #define __CONTROLS__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __QUICKDRAW__
  30. #include <Quickdraw.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <QuickdrawText.h>                                    */
  34.  
  35. #ifndef __MENUS__
  36. #include <Menus.h>
  37. #endif
  38. /*    #include <Memory.h>                                            */
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. #if PRAGMA_ALIGN_SUPPORTED
  45. #pragma options align=mac68k
  46. #endif
  47.  
  48. #if PRAGMA_IMPORT_SUPPORTED
  49. #pragma import on
  50. #endif
  51.  
  52. #ifndef STRICT_CONTROLS
  53. #define STRICT_CONTROLS 0
  54. #endif
  55. /*_________________________________________________________________________________________________________*/
  56. /**/
  57. /* • CONTROL DEFINITION ID'S*/
  58. /**/
  59. /*_________________________________________________________________________________________________________*/
  60. /**/
  61. /* Standard System 7 procID's for use only with NewControl()*/
  62. /**/
  63.  
  64. enum {
  65.     pushButProc                    = 0,
  66.     checkBoxProc                = 1,
  67.     radioButProc                = 2,
  68.     scrollBarProc                = 16,
  69.     popupMenuProc                = 1008
  70. };
  71.  
  72. enum {
  73.     kControlUsesOwningWindowsFontVariant = 1 << 3                /* Control uses owning windows font to display text*/
  74. };
  75.  
  76. /*_________________________________________________________________________________________________________*/
  77. /**/
  78. /* • CONTROL PART CODES*/
  79. /**/
  80. /*_________________________________________________________________________________________________________*/
  81. typedef SInt16 ControlPartCode;
  82.  
  83.  
  84. enum {
  85.     kControlNoPart                = 0,
  86.     kControlLabelPart            = 1,
  87.     kControlMenuPart            = 2,
  88.     kControlTrianglePart        = 4,
  89.     kControlButtonPart            = 10,
  90.     kControlCheckBoxPart        = 11,
  91.     kControlRadioButtonPart        = 11,
  92.     kControlUpButtonPart        = 20,
  93.     kControlDownButtonPart        = 21,
  94.     kControlPageUpPart            = 22,
  95.     kControlPageDownPart        = 23,
  96.     kControlIndicatorPart        = 129,
  97.     kControlDisabledPart        = 254,
  98.     kControlInactivePart        = 255
  99. };
  100.  
  101. /*_________________________________________________________________________________________________________*/
  102. /**/
  103. /* • CHECK BOX VALUES*/
  104. /**/
  105. /*_________________________________________________________________________________________________________*/
  106. enum {
  107.     kControlCheckboxUncheckedValue = 0,
  108.     kControlCheckboxCheckedValue = 1,
  109.     kControlCheckboxMixedValue    = 2
  110. };
  111.  
  112. /*_________________________________________________________________________________________________________*/
  113. /**/
  114. /* • RADIO BUTTON VALUES*/
  115. /**/
  116. /*_________________________________________________________________________________________________________*/
  117. enum {
  118.     kControlRadioButtonUncheckedValue = 0,
  119.     kControlRadioButtonCheckedValue = 1,
  120.     kControlRadioButtonMixedValue = 2
  121. };
  122.  
  123. /*_________________________________________________________________________________________________________*/
  124. /* */
  125. /* • CONTROL POP-UP MENU CONSTANTS*/
  126. /**/
  127. /*_________________________________________________________________________________________________________*/
  128. /**/
  129. /* Variant codes for the System 7 pop-up menu*/
  130. /**/
  131. enum {
  132.     popupFixedWidth                = 1 << 0,
  133.     popupVariableWidth            = 1 << 1,
  134.     popupUseAddResMenu            = 1 << 2,
  135.     popupUseWFont                = 1 << 3
  136. };
  137.  
  138. /**/
  139. /* Menu label styles for the System 7 pop-up menu */
  140. /**/
  141. enum {
  142.     popupTitleBold                = 1 << 8,
  143.     popupTitleItalic            = 1 << 9,
  144.     popupTitleUnderline            = 1 << 10,
  145.     popupTitleOutline            = 1 << 11,
  146.     popupTitleShadow            = 1 << 12,
  147.     popupTitleCondense            = 1 << 13,
  148.     popupTitleExtend            = 1 << 14,
  149.     popupTitleNoStyle            = 1 << 15
  150. };
  151.  
  152. /**/
  153. /* Menu label justifications for the System 7 pop-up menu*/
  154. /**/
  155. enum {
  156.     popupTitleLeftJust            = 0x00000000,
  157.     popupTitleCenterJust        = 0x00000001,
  158.     popupTitleRightJust            = 0x000000FF
  159. };
  160.  
  161. /*_________________________________________________________________________________________________________*/
  162. /**/
  163. /* • CONTROL DRAGGRAYRGN CONSTANTS*/
  164. /**/
  165. /*   For DragGrayRgnUPP used in TrackControl() */
  166. /**/
  167. /*_________________________________________________________________________________________________________*/
  168. enum {
  169.     noConstraint                = kNoConstraint,
  170.     hAxisOnly                    = 1,
  171.     vAxisOnly                    = 2
  172. };
  173.  
  174. /*_________________________________________________________________________________________________________*/
  175. /**/
  176. /* • CONTROL COLOR TABLE PART CODES*/
  177. /**/
  178. /*_________________________________________________________________________________________________________*/
  179. enum {
  180.     cFrameColor                    = 0,
  181.     cBodyColor                    = 1,
  182.     cTextColor                    = 2,
  183.     cThumbColor                    = 3
  184. };
  185.  
  186. /*_________________________________________________________________________________________________________*/
  187. /**/
  188. /* • CONTROL TYPE DECLARATIONS*/
  189. /**/
  190. /*_________________________________________________________________________________________________________*/
  191. /**/
  192. /* Define ControlRef and ControlHandle*/
  193. /**/
  194. #if STRICT_CONTROLS
  195. typedef struct OpaqueControlRef *ControlRef;
  196.  
  197. typedef ControlRef ControlHandle;
  198.  
  199. #else
  200. typedef struct ControlRecord ControlRecord, *ControlPtr, **ControlHandle;
  201.  
  202. typedef ControlHandle ControlRef;
  203.  
  204. #endif
  205. /*_________________________________________________________________________________________________________*/
  206. /**/
  207. /* • CONTROL ACTIONPROC POINTER*/
  208. /**/
  209. /*_________________________________________________________________________________________________________*/
  210. typedef pascal void (*ControlActionProcPtr)(ControlRef theControl, ControlPartCode partCode);
  211.  
  212. #if GENERATINGCFM
  213. typedef UniversalProcPtr ControlActionUPP;
  214. #else
  215. typedef ControlActionProcPtr ControlActionUPP;
  216. #endif
  217.  
  218. /*_________________________________________________________________________________________________________*/
  219. /**/
  220. /* • CONTROL COLOR TABLE STRUCTURE*/
  221. /**/
  222. /*_________________________________________________________________________________________________________*/
  223. struct CtlCTab {
  224.     SInt32                            ccSeed;
  225.     SInt16                            ccRider;
  226.     SInt16                            ctSize;
  227.     ColorSpec                        ctTable[4];
  228. };
  229. typedef struct CtlCTab CtlCTab;
  230.  
  231. typedef CtlCTab *CCTabPtr, **CCTabHandle;
  232.  
  233. #if !STRICT_CONTROLS
  234. /*_________________________________________________________________________________________________________*/
  235. /**/
  236. /* • CONTROL RECORD STRUCTURE*/
  237. /**/
  238. /*_________________________________________________________________________________________________________*/
  239. struct ControlRecord {
  240.     ControlRef                        nextControl;
  241.     WindowRef                        contrlOwner;
  242.     Rect                            contrlRect;
  243.     UInt8                            contrlVis;
  244.     UInt8                            contrlHilite;
  245.     SInt16                            contrlValue;
  246.     SInt16                            contrlMin;
  247.     SInt16                            contrlMax;
  248.     Handle                            contrlDefProc;
  249.     Handle                            contrlData;
  250.     ControlActionUPP                contrlAction;
  251.     SInt32                            contrlRfCon;
  252.     Str255                            contrlTitle;
  253. };
  254. /*_________________________________________________________________________________________________________*/
  255. /**/
  256. /* • AUXILLARY CONTROL RECORD STRUCTURE*/
  257. /**/
  258. /*_________________________________________________________________________________________________________*/
  259. struct AuxCtlRec {
  260.     Handle                            acNext;
  261.     ControlRef                        acOwner;
  262.     CCTabHandle                        acCTable;
  263.     SInt16                            acFlags;
  264.     SInt32                            acReserved;
  265.     SInt32                            acRefCon;
  266. };
  267. typedef struct AuxCtlRec AuxCtlRec;
  268.  
  269. typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHandle;
  270.  
  271. /*_________________________________________________________________________________________________________*/
  272. /**/
  273. /* • POP-UP MENU PRIVATE DATA STRUCTURE*/
  274. /**/
  275. /*_________________________________________________________________________________________________________*/
  276. struct PopupPrivateData {
  277.     MenuHandle                        mHandle;
  278.     SInt16                            mID;
  279. };
  280. typedef struct PopupPrivateData PopupPrivateData;
  281.  
  282. typedef PopupPrivateData *PopupPrivateDataPtr, **PopupPrivateDataHandle;
  283.  
  284. #endif
  285.  
  286. #if GENERATINGCFM
  287. #else
  288. #endif
  289.  
  290. enum {
  291.     uppControlActionProcInfo = kPascalStackBased
  292.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlRef)))
  293.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ControlPartCode)))
  294. };
  295.  
  296. #if GENERATINGCFM
  297. #define NewControlActionProc(userRoutine)        \
  298.         (ControlActionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlActionProcInfo, GetCurrentArchitecture())
  299. #else
  300. #define NewControlActionProc(userRoutine)        \
  301.         ((ControlActionUPP) (userRoutine))
  302. #endif
  303.  
  304. #if GENERATINGCFM
  305. #define CallControlActionProc(userRoutine, theControl, partCode)        \
  306.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlActionProcInfo, (theControl), (partCode))
  307. #else
  308. #define CallControlActionProc(userRoutine, theControl, partCode)        \
  309.         (*(userRoutine))((theControl), (partCode))
  310. #endif
  311.  
  312. /*_________________________________________________________________________________________________________*/
  313. /*    */
  314. /* • CONTROL CREATION / DELETION API'S*/
  315. /**/
  316. /*_________________________________________________________________________________________________________*/
  317. extern pascal ControlRef NewControl(WindowRef theWindow, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 value, SInt16 min, SInt16 max, SInt16 procID, SInt32 refCon)
  318.  ONEWORDINLINE(0xA954);
  319. extern pascal ControlRef GetNewControl(SInt16 controlID, WindowRef owner)
  320.  ONEWORDINLINE(0xA9BE);
  321. extern pascal void DisposeControl(ControlRef theControl)
  322.  ONEWORDINLINE(0xA955);
  323. extern pascal void KillControls(WindowRef theWindow)
  324.  ONEWORDINLINE(0xA956);
  325. /*_________________________________________________________________________________________________________*/
  326. /*    */
  327. /* • CONTROL SHOWING/HIDING API'S*/
  328. /**/
  329. /*_________________________________________________________________________________________________________*/
  330. extern pascal void ShowControl(ControlRef theControl)
  331.  ONEWORDINLINE(0xA957);
  332. extern pascal void HideControl(ControlRef theControl)
  333.  ONEWORDINLINE(0xA958);
  334. /*_________________________________________________________________________________________________________*/
  335. /*    */
  336. /* • CONTROL DRAWING API'S*/
  337. /**/
  338. /*_________________________________________________________________________________________________________*/
  339. extern pascal void DrawControls(WindowRef theWindow)
  340.  ONEWORDINLINE(0xA969);
  341. extern pascal void Draw1Control(ControlRef theControl)
  342.  ONEWORDINLINE(0xA96D);
  343. #define DrawOneControl(theControl) Draw1Control(theControl)
  344. extern pascal void UpdateControls(WindowRef theWindow, RgnHandle updateRegion)
  345.  ONEWORDINLINE(0xA953);
  346. /*_________________________________________________________________________________________________________*/
  347. /*    */
  348. /* • CONTROL HIGHLIGHT API'S*/
  349. /**/
  350. /*_________________________________________________________________________________________________________*/
  351. extern pascal void HiliteControl(ControlRef theControl, ControlPartCode hiliteState)
  352.  ONEWORDINLINE(0xA95D);
  353. extern pascal ControlPartCode TrackControl(ControlRef theControl, Point thePoint, ControlActionUPP actionProc)
  354.  ONEWORDINLINE(0xA968);
  355. extern pascal void DragControl(ControlRef theControl, Point startPoint, const Rect *limitRect, const Rect *slopRect, DragConstraint axis)
  356.  ONEWORDINLINE(0xA967);
  357. extern pascal ControlPartCode TestControl(ControlRef theControl, Point thePoint)
  358.  ONEWORDINLINE(0xA966);
  359. extern pascal ControlPartCode FindControl(Point thePoint, WindowRef theWindow, ControlRef *theControl)
  360.  ONEWORDINLINE(0xA96C);
  361. /*_________________________________________________________________________________________________________*/
  362. /*    */
  363. /* • CONTROL MOVING/SIZING API'S*/
  364. /**/
  365. /*_________________________________________________________________________________________________________*/
  366. extern pascal void MoveControl(ControlRef theControl, SInt16 h, SInt16 v)
  367.  ONEWORDINLINE(0xA959);
  368. extern pascal void SizeControl(ControlRef theControl, SInt16 w, SInt16 h)
  369.  ONEWORDINLINE(0xA95C);
  370. /*_________________________________________________________________________________________________________*/
  371. /*    */
  372. /* • CONTROL TITLE API'S*/
  373. /**/
  374. /*_________________________________________________________________________________________________________*/
  375. extern pascal void SetControlTitle(ControlRef theControl, ConstStr255Param title)
  376.  ONEWORDINLINE(0xA95F);
  377. extern pascal void GetControlTitle(ControlRef theControl, Str255 title)
  378.  ONEWORDINLINE(0xA95E);
  379. /*_________________________________________________________________________________________________________*/
  380. /*    */
  381. /* • CONTROL VALUE, MIMIMUM, AND MAXIMUM API'S*/
  382. /**/
  383. /*_________________________________________________________________________________________________________*/
  384. extern pascal SInt16 GetControlValue(ControlRef theControl)
  385.  ONEWORDINLINE(0xA960);
  386. extern pascal void SetControlValue(ControlRef theControl, SInt16 newValue)
  387.  ONEWORDINLINE(0xA963);
  388. extern pascal SInt16 GetControlMinimum(ControlRef theControl)
  389.  ONEWORDINLINE(0xA961);
  390. extern pascal void SetControlMinimum(ControlRef theControl, SInt16 newMinimum)
  391.  ONEWORDINLINE(0xA964);
  392. extern pascal SInt16 GetControlMaximum(ControlRef theControl)
  393.  ONEWORDINLINE(0xA962);
  394. extern pascal void SetControlMaximum(ControlRef theControl, SInt16 newMaximum)
  395.  ONEWORDINLINE(0xA965);
  396. /*_________________________________________________________________________________________________________*/
  397. /*    */
  398. /* • CONTROL VARIANT AND WINDOW INFORMATION API'S*/
  399. /**/
  400. /*_________________________________________________________________________________________________________*/
  401. extern pascal SInt16 GetControlVariant(ControlRef theControl)
  402.  ONEWORDINLINE(0xA809);
  403. /*_________________________________________________________________________________________________________*/
  404. /*    */
  405. /* • CONTROL ACTION PROC API'S*/
  406. /**/
  407. /*_________________________________________________________________________________________________________*/
  408. extern pascal void SetControlAction(ControlRef theControl, ControlActionUPP actionProc)
  409.  ONEWORDINLINE(0xA96B);
  410. extern pascal ControlActionUPP GetControlAction(ControlRef theControl)
  411.  ONEWORDINLINE(0xA96A);
  412. /*_________________________________________________________________________________________________________*/
  413. /*    */
  414. /* • CONTROL ACCESSOR API'S*/
  415. /**/
  416. /*_________________________________________________________________________________________________________*/
  417. extern pascal void SetControlReference(ControlRef theControl, SInt32 data)
  418.  ONEWORDINLINE(0xA95B);
  419. extern pascal SInt32 GetControlReference(ControlRef theControl)
  420.  ONEWORDINLINE(0xA95A);
  421. /*_________________________________________________________________________________________________________*/
  422. /*    */
  423. /* • PREPARE FOR THE COPLAND MACINTOSH OS NOW*/
  424. /**/
  425. /*     The window control list is moving to the Control Manager.  In addition, to prepare for Copland, you*/
  426. /*     want to try to begin compiling with STRICT_CONTROLS and STRICT_WINDOWS turned on.  This makes the*/
  427. /*     ControlRecord and WindowRecord opaque and you will be unable to access the fields directly.  If you*/
  428. /*     need information from one of these fields, use one of the provided accessor functions.  For now,*/
  429. /*     the new accessor functions are provided as macros, but in Copland they will become true API entry*/
  430. /*      points.*/
  431. /**/
  432. /*     So what does this all mean?  Replace all references to the window control list in the WindowRecord*/
  433. /*     with the macro below.  Then in the future when Copland interfaces are available, no source changes*/
  434. /*     will be required and the macro will automatically replaced with a call to the real API.*/
  435. /**/
  436. /*     Please direct all questions regarding usuage to the TOOLBOX AppleLink address.*/
  437. /**/
  438. /*     <<<< See Windows.h for more information >>>>>*/
  439. /**/
  440. /*_________________________________________________________________________________________________________*/
  441. #define GetControlListFromWindow(theWindowRef)        ( *(ControlRef *) (((UInt8 *) theWindowRef) + sizeof(GrafPort) + 0x20))
  442. #if !STRICT_CONTROLS
  443. extern pascal Boolean GetAuxiliaryControlRecord(ControlRef theControl, AuxCtlHandle *acHndl)
  444.  ONEWORDINLINE(0xAA44);
  445. #endif
  446. extern pascal void SetControlColor(ControlRef theControl, CCTabHandle newColorTable)
  447.  ONEWORDINLINE(0xAA43);
  448. /*_________________________________________________________________________________________________________*/
  449. /*    */
  450. /* • VALID 'CDEF' MESSAGES*/
  451. /**/
  452. /*_________________________________________________________________________________________________________*/
  453. typedef SInt16 ControlDefProcMessage;
  454.  
  455.  
  456. enum {
  457.     drawCntl                    = 0,
  458.     testCntl                    = 1,
  459.     calcCRgns                    = 2,
  460.     initCntl                    = 3,
  461.     dispCntl                    = 4,
  462.     posCntl                        = 5,
  463.     thumbCntl                    = 6,
  464.     dragCntl                    = 7,
  465.     autoTrack                    = 8,
  466.     calcCntlRgn                    = 10,
  467.     calcThumbRgn                = 11,
  468.     drawThumbOutline            = 12
  469. };
  470.  
  471. /*_________________________________________________________________________________________________________*/
  472. /*    */
  473. /* • MAIN ENTRY POINT FOR 'CDEF'*/
  474. /**/
  475. /*_________________________________________________________________________________________________________*/
  476. typedef pascal SInt32 (*ControlDefProcPtr)(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param);
  477.  
  478. #if GENERATINGCFM
  479. typedef UniversalProcPtr ControlDefUPP;
  480. #else
  481. typedef ControlDefProcPtr ControlDefUPP;
  482. #endif
  483.  
  484. enum {
  485.     uppControlDefProcInfo = kPascalStackBased
  486.          | RESULT_SIZE(SIZE_CODE(sizeof(SInt32)))
  487.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SInt16)))
  488.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ControlRef)))
  489.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ControlDefProcMessage)))
  490.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(SInt32)))
  491. };
  492.  
  493. #if GENERATINGCFM
  494. #define NewControlDefProc(userRoutine)        \
  495.         (ControlDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlDefProcInfo, GetCurrentArchitecture())
  496. #else
  497. #define NewControlDefProc(userRoutine)        \
  498.         ((ControlDefUPP) (userRoutine))
  499. #endif
  500.  
  501. #if GENERATINGCFM
  502. #define CallControlDefProc(userRoutine, varCode, theControl, message, param)        \
  503.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlDefProcInfo, (varCode), (theControl), (message), (param))
  504. #else
  505. #define CallControlDefProc(userRoutine, varCode, theControl, message, param)        \
  506.         (*(userRoutine))((varCode), (theControl), (message), (param))
  507. #endif
  508.  
  509. /*_________________________________________________________________________________________________________*/
  510. /*    */
  511. /* • CONSTANTS FOR DRAWCNTL MESSAGE PASSED IN PARAM*/
  512. /**/
  513. /*_________________________________________________________________________________________________________*/
  514. enum {
  515.     kDrawControlEntireControl    = 0,
  516.     kDrawControlIndicatorOnly    = 129
  517. };
  518.  
  519. /*_________________________________________________________________________________________________________*/
  520. /*    */
  521. /* • CONSTANTS FOR DRAGCNTL MESSAGE PASSED IN PARAM*/
  522. /**/
  523. /*_________________________________________________________________________________________________________*/
  524. enum {
  525.     kDragControlEntireControl    = 0,
  526.     kDragControlIndicator        = 1
  527. };
  528.  
  529. /*_________________________________________________________________________________________________________*/
  530. /*    */
  531. /* • DRAG CONSTRAINT STRUCTURE PASSED IN PARAM FOR THUMBCNTL MESSAGE (IM I-332)*/
  532. /**/
  533. /*_________________________________________________________________________________________________________*/
  534. struct IndicatorDragConstraint {
  535.     Rect                            limitRect;
  536.     Rect                            slopRect;
  537.     DragConstraint                    axis;
  538. };
  539. typedef struct IndicatorDragConstraint IndicatorDragConstraint;
  540.  
  541. typedef IndicatorDragConstraint *IndicatorDragConstraintPtr, **IndicatorDragConstraintHandle;
  542.  
  543. /*_________________________________________________________________________________________________________*/
  544. /**/
  545. /* • OLD ROUTINE NAMES*/
  546. /**/
  547. /*   These are provided for compatiblity with older source bases.  It is recommended to not use them since*/
  548. /*     they may removed from this interface file at any time.*/
  549. /**/
  550. /*_________________________________________________________________________________________________________*/
  551. #if OLDROUTINENAMES
  552.  
  553. enum {
  554.     useWFont                    = 8
  555. };
  556.  
  557. enum {
  558.     inLabel                        = 1,
  559.     inMenu                        = 2,
  560.     inTriangle                    = 4,
  561.     inButton                    = 10,
  562.     inCheckBox                    = 11,
  563.     inUpButton                    = 20,
  564.     inDownButton                = 21,
  565.     inPageUp                    = 22,
  566.     inPageDown                    = 23,
  567.     inThumb                        = 129
  568. };
  569.  
  570. enum {
  571.     kNoHiliteControlPart        = 0,
  572.     kInLabelControlPart            = 1,
  573.     kInMenuControlPart            = 2,
  574.     kInTriangleControlPart        = 4,
  575.     kInButtonControlPart        = 10,
  576.     kInCheckBoxControlPart        = 11,
  577.     kInUpButtonControlPart        = 20,
  578.     kInDownButtonControlPart    = 21,
  579.     kInPageUpControlPart        = 22,
  580.     kInPageDownControlPart        = 23,
  581.     kInIndicatorControlPart        = 129,
  582.     kReservedControlPart        = 254,
  583.     kControlInactiveControlPart    = 255
  584. };
  585.  
  586. #endif
  587. #if CGLUESUPPORTED
  588. extern void dragcontrol(ControlRef theControl, Point *startPt, const Rect *limitRect, const Rect *slopRect, short axis);
  589. extern ControlRef newcontrol(WindowRef theWindow, const Rect *boundsRect, const char *title, Boolean visible, short value, short min, short max, short procID, long refCon);
  590. extern short findcontrol(Point *thePoint, WindowRef theWindow, ControlRef *theControl);
  591. extern void getcontroltitle(ControlRef theControl, char *title);
  592. extern void setcontroltitle(ControlRef theControl, const char *title);
  593. extern short trackcontrol(ControlRef theControl, Point *thePoint, ControlActionUPP actionProc);
  594. extern short testcontrol(ControlRef theControl, Point *thePt);
  595. #endif
  596. #if OLDROUTINENAMES
  597. #define GetControlOwningWindowControlList(theWindowRef)        ( *(ControlRef *) (((UInt8 *) theWindowRef) + sizeof(GrafPort) + 0x20))
  598. #define SetCTitle(theControl, title) SetControlTitle(theControl, title)
  599. #define GetCTitle(theControl, title) GetControlTitle(theControl, title)
  600. #define UpdtControl(theWindow, updateRgn) UpdateControls(theWindow, updateRgn)
  601. #define SetCtlValue(theControl, theValue) SetControlValue(theControl, theValue)
  602. #define GetCtlValue(theControl) GetControlValue(theControl)
  603. #define SetCtlMin(theControl, minValue) SetControlMinimum(theControl, minValue)
  604. #define GetCtlMin(theControl) GetControlMinimum(theControl)
  605. #define SetCtlMax(theControl, maxValue) SetControlMaximum(theControl, maxValue)
  606. #define GetCtlMax(theControl) GetControlMaximum(theControl)
  607. #define GetAuxCtl(theControl, acHndl) GetAuxiliaryControlRecord(theControl, acHndl)
  608. #define SetCRefCon(theControl, data) SetControlReference(theControl, data)
  609. #define GetCRefCon(theControl) GetControlReference(theControl)
  610. #define SetCtlAction(theControl, actionProc) SetControlAction(theControl, actionProc)
  611. #define GetCtlAction(theControl) GetControlAction(theControl)
  612. #define SetCtlColor(theControl, newColorTable) SetControlColor(theControl, newColorTable)
  613. #define GetCVariant(theControl) GetControlVariant(theControl)
  614. #if CGLUESUPPORTED
  615. #define getctitle(theControl, title) getcontroltitle(theControl, title)
  616. #define setctitle(theControl, title) setcontroltitle(theControl, title)
  617. #endif
  618. #endif
  619.  
  620. #if PRAGMA_IMPORT_SUPPORTED
  621. #pragma import off
  622. #endif
  623.  
  624. #if PRAGMA_ALIGN_SUPPORTED
  625. #pragma options align=reset
  626. #endif
  627.  
  628. #ifdef __cplusplus
  629. }
  630. #endif
  631.  
  632. #endif /* __CONTROLS__ */
  633.